import request from '@/utils/request'

// 创建段别线别绑定
export function createSegmentLine(data) {
  return request({
    url: '/lamp/segment-line/create',
    method: 'post',
    data: data
  })
}

// 更新段别线别绑定
export function updateSegmentLine(data) {
  return request({
    url: '/lamp/segment-line/update',
    method: 'put',
    data: data
  })
}

// 删除段别线别绑定
export function deleteSegmentLine(id) {
  return request({
    url: '/lamp/segment-line/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除段别线别绑定 */
export function deleteSegmentLineList(ids) {
  return request({
    url: `/lamp/segment-line/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得段别线别绑定
export function getSegmentLine(id) {
  return request({
    url: '/lamp/segment-line/get?id=' + id,
    method: 'get'
  })
}

// 获得段别线别绑定分页
export function getSegmentLinePage(params) {
  return request({
    url: '/lamp/segment-line/page',
    method: 'get',
    params
  })
}
// 导出段别线别绑定 Excel
export function exportSegmentLineExcel(params) {
  return request({
    url: '/lamp/segment-line/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}